<!--
 * @Descripttion: 
 * @Author: voanit
 * @Date: 2022-06-29 16:52:22
 * @LastEditors: voanit
 * @LastEditTime: 2022-06-29 17:03:46
-->
<template>
  <div>
    御剑乘风来,除魔天地间!===vue3===v-model==={{ modelValue }}
    <button @click="btn">modelValue</button>
  </div>
</template>
<script>
export default {
  name: '',
  props: {
    /* v2:v-model 接收数据默认是value */
    /* v3:v-model 接收数据默认是modelValue */
    modelValue: {
      type: String
    }
  },
  setup (props, { emit }) {
    const btn = () => {
      console.log(props.modelValue, 11);
      //v2 使用修饰符sync 更改传过来的数据  this.$emit('update:modelValue','更改的值')
      emit('update:modelValue', 'v-model-change')
    }

    return { btn }
  }
}
</script>
<style lang='less'  scoped>
</style>